<script type="text/javascript">
$(function(){
	var pg = App.base.appInstView.ui, pp = pg.params;
		
 	var frm = {
			path: pg.seek('path'),
			port: pg.seek('port'),
			user: pg.seek('user'),
			appCode: pg.seek('appCode'),
			appName: pg.seek('appName'),
			serverCode: pg.seek('serverCode'),
			serverName: pg.seek('serverName')
		};
	
	function setValues(o){
		frm.path.val(o.data.path);
		frm.port.val(o.data.port);
		frm.user.val(o.data.user); 
	} 
	function setApp(o){
		frm.appCode.val(o.app.code);
		frm.appName.val(o.app.name);
	}
	function setServer(o){
		frm.serverCode.val(o.data.code);
		frm.serverName.val(o.data.name);
	}

	getServer(pp.data.serverId);
	getApp(pp.data.appId);
	setValues(pp);
	
	pg.seek('close').click(function(){
		pg.close();
	});
	
	function getServer(serverId){
		$.post('/deploy/server/get.do', {
			id:serverId
		}, function(rs) {
			var server = mac.eval(rs);
			if (server.success) {
				setServer(server);
			} else {
				pg.seek('msg').html(mac.msg(ro.data, ro.params));
			}
		});
	}
	
	function getApp(appId){
		$.post('/deploy/app/get.do', {
			id:appId
		}, function(rs) {
			var app = mac.eval(rs);				
			if (app.success) {
				setApp(app);
			} else {
				pg.seek('msg').html(mac.msg(ro.data, ro.params));
			}
		});
	}
});
</script>
<div class="left">
	<div class="form">
		<div class="item">
			<span class="label">应用编号：</span>
			<input type="text" name="appCode"  disabled />
			<div class="clear"></div>
		</div>
		<div class="item">
			<span class="label">应用名称：</span>
			<input type="text" name="appName" disabled />
			<div class="clear"></div>
		</div>
		<div class="item">
			<span class="label">服务器编号：</span>
			<div class="input">
				<input type="text" name="serverCode"  disabled />
			</div>
			<div class="clear"></div>
		</div>
		<div class="item">
			<span class="label">服务器名称：</span>
			<input type="text" name="serverName"  disabled />
			<div class="clear"></div>
		</div>
		<div class="item">
			<span class="label">根路径：</span>
			<input type="text" name="path" disabled />
			<div class="clear"></div>
		</div>
		<div class="item">
			<span class="label">用户：</span>
			<input type="text" name="user"  disabled />
			<div class="clear"></div>
		</div>
		<div class="item">
			<span class="label">端口号：</span>
			<input type="text" name="port" disabled />
			<div class="clear"></div>
		</div>
		<div class="item">
			<span class="label"></span>
			<span class="msg" name="msg"></span>
			<div class="clear"></div>
		</div>
		<div class="bottom">
			<button name="close" class="addBtn">关闭</button>
		</div>
	</div>
</div>
